package fr.umlv.j2ee.patterns.businessdelegate;

import javax.naming.InitialContext;
import javax.naming.NamingException;

import fr.umlv.j2ee.patterns.sessionfacade.FacadBusiness;

public class LookupService {

	private static  LookupService service;
	
	private LookupService(){}
	
	
	public static LookupService getInstance(){
		if(service == null)
			service = new LookupService();
		
		return service;
	}
	
	
	public FacadBusiness getFacad() throws NamingException{
		InitialContext ctx = new InitialContext();
		return (FacadBusiness) ctx.lookup("FacadBean/remote");
	}
	
	
	
	
	
	
}
